/**
 */
package org.fernando.planificacionDeCursada.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.fernando.planificacionDeCursada.DIA;
import org.fernando.planificacionDeCursada.DisponibilidadProf;
import org.fernando.planificacionDeCursada.PlanificacionDeCursadaPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Disponibilidad Prof</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.fernando.planificacionDeCursada.impl.DisponibilidadProfImpl#getDia <em>Dia</em>}</li>
 *   <li>{@link org.fernando.planificacionDeCursada.impl.DisponibilidadProfImpl#getHoraInicial <em>Hora Inicial</em>}</li>
 *   <li>{@link org.fernando.planificacionDeCursada.impl.DisponibilidadProfImpl#getHoraFinal <em>Hora Final</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DisponibilidadProfImpl extends MinimalEObjectImpl.Container implements DisponibilidadProf
{
  /**
   * The cached value of the '{@link #getDia() <em>Dia</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDia()
   * @generated
   * @ordered
   */
  protected DIA dia;

  /**
   * The default value of the '{@link #getHoraInicial() <em>Hora Inicial</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getHoraInicial()
   * @generated
   * @ordered
   */
  protected static final int HORA_INICIAL_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getHoraInicial() <em>Hora Inicial</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getHoraInicial()
   * @generated
   * @ordered
   */
  protected int horaInicial = HORA_INICIAL_EDEFAULT;

  /**
   * The default value of the '{@link #getHoraFinal() <em>Hora Final</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getHoraFinal()
   * @generated
   * @ordered
   */
  protected static final int HORA_FINAL_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getHoraFinal() <em>Hora Final</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getHoraFinal()
   * @generated
   * @ordered
   */
  protected int horaFinal = HORA_FINAL_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected DisponibilidadProfImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return PlanificacionDeCursadaPackage.Literals.DISPONIBILIDAD_PROF;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DIA getDia()
  {
    return dia;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetDia(DIA newDia, NotificationChain msgs)
  {
    DIA oldDia = dia;
    dia = newDia;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__DIA, oldDia, newDia);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDia(DIA newDia)
  {
    if (newDia != dia)
    {
      NotificationChain msgs = null;
      if (dia != null)
        msgs = ((InternalEObject)dia).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__DIA, null, msgs);
      if (newDia != null)
        msgs = ((InternalEObject)newDia).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__DIA, null, msgs);
      msgs = basicSetDia(newDia, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__DIA, newDia, newDia));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getHoraInicial()
  {
    return horaInicial;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setHoraInicial(int newHoraInicial)
  {
    int oldHoraInicial = horaInicial;
    horaInicial = newHoraInicial;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__HORA_INICIAL, oldHoraInicial, horaInicial));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getHoraFinal()
  {
    return horaFinal;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setHoraFinal(int newHoraFinal)
  {
    int oldHoraFinal = horaFinal;
    horaFinal = newHoraFinal;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__HORA_FINAL, oldHoraFinal, horaFinal));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__DIA:
        return basicSetDia(null, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__DIA:
        return getDia();
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__HORA_INICIAL:
        return getHoraInicial();
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__HORA_FINAL:
        return getHoraFinal();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__DIA:
        setDia((DIA)newValue);
        return;
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__HORA_INICIAL:
        setHoraInicial((Integer)newValue);
        return;
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__HORA_FINAL:
        setHoraFinal((Integer)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__DIA:
        setDia((DIA)null);
        return;
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__HORA_INICIAL:
        setHoraInicial(HORA_INICIAL_EDEFAULT);
        return;
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__HORA_FINAL:
        setHoraFinal(HORA_FINAL_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__DIA:
        return dia != null;
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__HORA_INICIAL:
        return horaInicial != HORA_INICIAL_EDEFAULT;
      case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF__HORA_FINAL:
        return horaFinal != HORA_FINAL_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (horaInicial: ");
    result.append(horaInicial);
    result.append(", horaFinal: ");
    result.append(horaFinal);
    result.append(')');
    return result.toString();
  }

} //DisponibilidadProfImpl
